import java.io.FileWriter;
import java.io.IOException;
 
public class EscritaFicheiros
{
  /* public static void main(String [] args)
   {
	   generateCsvFile("testing.csv"); 
	   
   }*/
 
   private static void generateCsvFile(String sFileName)
   {
	try
	{
	    FileWriter writer = new FileWriter(sFileName);
 
	    writer.append("Nome");
	    writer.append(',');
	    writer.append("Morada");
	    writer.append("DataDeVenda");
	    writer.append(',');
	    writer.append("DataDeEntrega");
	    writer.append('\n');
 
	    //generate whatever data you want
 
	    writer.flush();
	    writer.close();
	}
	catch(IOException e)
	{
	     e.printStackTrace();
	} 
    }
}